import java.io.File;
import java.io.Reader;

import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

	/**
	 * @param args
	 */
	public static void DirToTree(String pathDir, String level)
	{
		File dir = new File(pathDir);
		String[] pathList= dir.list();
		File fileDirTemp=null;
		level+="|";
		for (String pathTemp: pathList)
		{
			fileDirTemp= new File(pathDir+'/'+pathTemp);
			if (fileDirTemp.isDirectory())
			{
				System.out.println(level+"-"+pathTemp+'/');
				DirToTree(pathDir+'/'+pathTemp,level+ "   ");
			} else {
				System.out.println(level+"-"+pathTemp);
			}
		}	
	}
	
	public static void main(String[] args) 
	{
		DirToTree("d:/download/film","");   // format of dir "dirName", "C:/dirName"
	}
}
